import { ref } from 'vue'
import { defineStore } from 'pinia'
export const includesStore = defineStore(
  'includesStore',
  () => {
    const includes = ref([])
    const setIncludes = (arr) => {
      includes.value = arr
    }

    const clearIncludes = () => {
      includes.value = []
    }
    return {
      includes,
      setIncludes,
      clearIncludes
    }
  },
  //持久化存储
  { persist: true }
)

export const defalutSetStore = defineStore(
  'defalutSetStore',
  () => {
    const defalutSet = ref({})
    const setDefalutSet = (obj) => {
      defalutSet.value = obj
    }

    const clearDefalutSet = () => {
      includes.value = null
    }
    return {
      defalutSet,
      setDefalutSet,
      clearDefalutSet
    }
  },
  { persist: true }
)

export const MusicSetStore = defineStore(
  'MusicSetStore',
  () => {
    const MusicSet = ref({})
    const setMusicSet = (obj) => {
      MusicSet.value = obj
    }

    const clearMusicSet = () => {
      includes.value = null
    }
    return {
      MusicSet,
      setMusicSet,
      clearMusicSet
    }
  },
  { persist: true }
)
